package com.cheney.diandireader.server.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;

import com.cheney.diandireader.server.domain.AttachFile;
import com.cheney.diandireader.server.domain.Users;
import com.cheney.diandireader.server.service.UserService;



@Controller
@RequestMapping("/loginAction")
public class LoginAction {
	
	@Autowired
	private UserService userService;
	
	@RequestMapping(value="/save")
	public String save(Users user){
		
		return "share/done";
	}

	@RequestMapping("/upload")
	public String upload(AttachFile file){
		MultipartFile muFile = file.getFile();
		Users users = new Users();
		userService.save(users);
		return "share/done";
	}
}
